import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Info from '../components/Info/AppleInfo.vue'
import IpadShop from '../components/ShopList/IpadPage.vue'
import seachs from '../components/Info/Seach.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: function () {
      return import(/* webpackChunkName: "about" */ '../views/About.vue')
    }
  },
  {
    path: '/cart',
    name: 'Cart',
    component: function () {
      return import(/* webpackChunkName: "about" */ '../views/Cart.vue')
    }
  },
  {
    path: '/myslf',
    name: 'Myslf',
    component: function () {
      return import(/* webpackChunkName: "about" */ '../views/Myslf.vue')
    }
  },
  {
    path:'/info',
    name:'Info',
    component:Info
  },
  {
    path:'/ipadshop',
    name:'IpadShop',
    component:IpadShop
  },
  {
    path:'/seach',
    name:'seachs',
    component:seachs
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
